package com.demo2do.fms.admin.service.business;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.entity.result.HttpResult;
import com.demo2do.fms.admin.entity.report.business.ShipmentReportSearch;
import com.demo2do.fms.admin.entity.search.business.ShipmentSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.entity.business.Shipment;
import com.demo2do.fms.entity.business.shipment.DispatchOrder;
import com.demo2do.fms.entity.business.shipment.ShipmentLine;
import com.demo2do.fms.entity.business.shipment.ShipmentOrder;

/**
 * 
 * @author Ysy
 *
 */
public interface ShipmentService {
    
    /**
     * 调度指令查询 
     * 
     * @param shipmentSearch
     * @return
     */
    public int countShipment(ShipmentSearch shipmentSearch);
    
    /**
     * 调度指令查询 
     * 
     * @param shipmentSearch
     * @param page
     * @return
     */
    public List<ShipmentLine> listShipment(ShipmentSearch shipmentSearch, Page page);
    
    /**
     * 生成派车单校验
     * 
     * @param loadNumber
     * 
     */
    public void validateDispatchOrderGenerate(String loadNumber);
    
    /**
     * 准备生成派车单
     * 
     * @param shipment
     * @return
     */
    public DispatchOrder preGenerateDispatchOrder(ShipmentLine shipment);
    
    /**
     * 生成派车单
     * 
     * @param dispatchOrder
     * @param loadNumber
     * @param oilTypeId
     * @param login
     * @return
     */
    public Long generateDispatchOrder(DispatchOrder dispatchOrder, String loadNumber, Long oilTypeId, Login login);
    
    /**
     * 生成修改派车单
     * 
     * @param dispatchOrder
     * @param loadNumber
     * @param oilTypeId
     * @param adjustmentDistance
     * @param transportCost
     * @param otherFeeTypeIds
     * @param otherFees
     * @param login
     * @return
     */
    public Long generateUpdateDispatchOrder(DispatchOrder dispatchOrder, String loadNumber, Long oilTypeId, BigDecimal adjustmentDistance, BigDecimal roadFee, List<Long> otherFeeTypeIds, List<BigDecimal> otherFees, Login login, String otherFeeAuditor);
        
    
    /**
     * load shipment_line by loadNumber
     *  
     * @param loadNumber
     * @return
     */
    public ShipmentLine loadShipmentLine(String loadNumber);
    
    /**
     * load shipment by shipment_id
     * 
     * @param shipmentId
     * @return
     */
    public Shipment loadShipment(Long shipmentId);
    
    /**
     * load shipment by loadNumber and orgIds
     * 
     * @param loadNumber
     * @param orgIds
     * @return
     */
    public Shipment loadShipment(String loadNumber, List<Long> orgIds);
    
    /**
     * list shipment_order by dispatch_order_id
     * 
     * @param dispatchOrderId
     * @return
     */
    public List<ShipmentOrder> listShipmentOrder(Long dispatchOrderId);
    
    /**
     * list shipment_orders by load_number
     * 
     * @param loadNumber
     * @return
     */
    public List<ShipmentOrder> listShipmentOrder(String loadNumber);
    
    /**
     * list shipment_orders by dispatch_order_id and load_number
     * 
     * @param dispatchOrderId
     * @param loadNumber
     * @return
     */
    public List<ShipmentOrder> listShipmentOrder(Long dispatchOrderId, String loadNumber);
    
    /**
     * list shipment_orders by dispatchOrderIds
     * 
     * @param dispatchOrderIds
     * @return
     */
    public List<ShipmentOrder> listShipmentOrder(List<Long> dispatchOrderIds);
    
    /**
     * @param search
     * @return
     */
    public List<Map<String, Object>> exportAll(ShipmentReportSearch search);
    
    /**
     * @param shipment
     * @return
     */
    public HttpResult getElectronicImage(Shipment shipment);
    
}